<template>
	<sw-file-uploader v-model="uploadFile" v-bind="uploadConfig" />
</template>

<script>
export default {
	props: {
		value: { type: String, default: '' },
		type: { type: String, default: '1' },
		accept: { type: String, default: '' },
		disabled: { type: Boolean, default: false }
	},
	data() {
		return {
			uploadFile: this.value,
			uploadConfig: {
				type: this.type,
				accept: this.accept,
				disabled: this.disabled,
				class: 'my_file_uploader'
			}
		};
	},
	watch: {
		value(val) {
			this.uploadFile = val;
		},
		uploadFile(val) {
			console.log(val);
			this.$emit('input', val);
		}
	}
};
</script>

<style lang="scss" scoped>
.my_file_uploader {
	&:deep(.el-upload) {
		.el-button {
			font-size: 15px;
		}
	}
	&:deep(.el-upload-list__item) {
		h4 {
			font-size: 16px;
		}
		.el-button {
			font-size: 16px;
		}
	}
}
</style>
